
const express = require('express');
const app = express();
app.listen(require('./config/config').port,()=>console.log( `api服务启动端口为${require('./config/config').port}` ))


app.use(express.static('public'))

app.use(require('body-parser').urlencoded({extended:false}));

app.use(require('cookie-parser')());

app.use(require('cors')())



require('./utils/connect')


let {writeLog} = require('./middleware/log');

app.use(writeLog);




app.use('/api/user',require('./routers/user'))






// 小任务---添加错误日志及404页面响应